package spring.cloud.study;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.cloud.netflix.hystrix.EnableHystrix;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.Bean;
import org.springframework.web.client.RestTemplate;

//@SpringCloudApplication

@EnableDiscoveryClient // 将该服务注册为Eureka客户端应用，获得服务发现的能力。
@EnableFeignClients	  //开启feign客户端调用支持
@EnableHystrix //开启Hystrix的服务
@SpringBootApplication
public class ConsumerFeignApp {
	
	@Bean
	@LoadBalanced//配置Ribbon负载均衡远程调用
	public RestTemplate restTemplate() {
		return new RestTemplate();
	}
	
	
	public static void main(String[] args) {
		SpringApplication.run(ConsumerFeignApp.class, args);
	}
}
